//
//  ZuoZheCollectionViewCell.m
//  C17
//
//  Created by dllo on 16/3/12.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "ZuoZheCollectionViewCell.h"
#import "LEffectLabel.h"


@implementation ZuoZheCollectionViewCell

- (void)awakeFromNib {
    // Initialization code
    //给视图添加一个毛玻璃的效果
    UIBlurEffect *effect=[UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];
    UIVisualEffectView *view=[[UIVisualEffectView alloc] initWithEffect:effect];
    view.alpha=0.8;
    view.frame=CGRectMake(0, 0, _downImageView.frame.size.width, _downImageView.frame.size.height);
    [_downImageView addSubview:view];
    
    LEffectLabel *effectLabel = [[LEffectLabel alloc] initWithFrame:CGRectMake(WIDTH/3*2, HEIGHT-250, WIDTH/4, 50)];
    [self addSubview:effectLabel];
    effectLabel.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
    
    effectLabel.font = [UIFont boldSystemFontOfSize:20];
    effectLabel.text = @"<< 左滑查看";
    
    effectLabel.textColor = [UIColor whiteColor];
    effectLabel.effectColor = [UIColor redColor];
    effectLabel.effectDirection = EffectDirectionTopLeftToBottomRight;
    
    for (int i = 0; i < 8; i++)
    {
        int64_t delayInSeconds = 3 * i;
        dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC);
        dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
            effectLabel.effectDirection = i;
            [effectLabel performEffectAnimation];
        });
    }
    
}

@end
